package AcWing周赛;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: a
 * Date: 2022-09-04
 * Time: 9:09
 */
public class Demo67_3 {
    private Map<Integer, Integer> map = new HashMap<>();


    /*private static long work(int begin, int end, int[] a, int k){
        long res = 0;
        for(int i = begin; i <= end; i++){
            int r = a[i] % k;
            if(r > 0){
                r = k - r;
            }
            int t = 0, x = a[i];
            while(t > 0){
                t++;
                x /= 10;
            }
            res +=
        }
    }*/

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        int[] a = new int[n];
        for(int i = 0; i < n; i++){
            a[i] = scanner.nextInt();
        }
        long res = 0;
        //res += work(0, n - 1, a, k);
        //res += work(n - 1, 0, a, k);
        System.out.println(res);
    }
}
